home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacAddict 123
/
MacAddict_123_2006_11.iso
/
Software
/
Internet & Communication
/
GarageSale 2.4.4.dmg
/
GarageSale.app
/
Contents
/
Resources
/
Scripts
/
EntourageDelivery.applescript
next >
Wrap
Text File
|
2006-08-27
|
2KB
|
40 lines
on sendMessage(inAdress, inSubject, inContent)
tell application "Microsoft Entourage"
activate
set inContent to my SearchReplace(inContent, (ASCII character 10) as Unicode text, (ASCII character 13) as Unicode text)
set theAdress to {address:{address:inAdress}, recipient type:to recipient}
set newMessage to make outgoing message at out box folder with properties {subject:inSubject, content:inContent, recipient:theAdress}
tell newMessage
open
end tell
end tell
end sendMessage
on sendMessageWithCc(inAdress, inSubject, inContent, inCc)
tell application "Microsoft Entourage"
activate
set theAdresses to {{address:{address:inAdress}, recipient type:to recipient}, {address:{address:inCc}, recipient type:cc recipient}}
set newMessage to make outgoing message at out box folder with properties {subject:inSubject, content:inContent, recipient:theAdresses}
tell newMessage
open
end tell
end tell
end sendMessageWithCc
on SearchReplace(mainString, searchString, replaceString)
-- keep searching while searchString is still found
considering case
repeat while mainString contains searchString
set foundOffset to offset of searchString in mainString
set temp to ""
set temp to (text 1 thru (foundOffset - 1) of mainString)
set temp to temp & replaceString
set temp to temp & (text (foundOffset + (count of searchString)) thru ((count of mainString) - 1) of mainString)
set mainString to ""
set mainString to temp
end repeat
end considering
return mainString
end SearchReplace